import Vuex from 'vuex'
import { setToken, getToken } from '@/util/auth'
export default new Vuex.Store({
  state: {
    user: getToken('user'),
    pwd: getToken('pwd')
  },
  getters: {

  },
  mutations: {
    setUser (state, user) {
      state.user = user;
      setToken('user', user);
    },
    setPwd (state, pwd) {
      state.pwd = pwd;
      setToken('pwd', pwd);
    },
  },
  actions: {


  }
})